#pragma once
#include<ctime>
#include"PoseGrabber.h"
#include"Fitting.h"
#include"Mapping.h"
#include"Config.h"
#include"Observation.h"
#include<string>
#include<vector>
#include<pcl/visualization/pcl_visualizer.h>
#include<map>
struct confi{

	float width_of_road{.0};
	int interval =0;
	int max_iterate = 0;
	//iterate of ICP registe
	
	string _sequence;
	string bin_input_path;
	string pcd_input_path;
	string pose_data_path;
	//out put 
	string pcd_output_path;
	string bin_map_path;
	string logcat_path;
	string pcd_map_path;

	//run
	int _iterate = 10;

	int segicp=0 ;

	int icp = 0;

	int create_map = 0;

	int create_noisy_map = 0;

	float noisy = 0.0;

	//3d show option
	int show_3d = 0;

	int show_ground_truth = 0;

	int show_ground_truth_with_noisy = 0;

	int color_with_z = 0;

};

class MapBuildeApplication
{
public:
	MapBuildeApplication();
	~MapBuildeApplication();
	void logOutPut(string root, string score_name, string time_name, vector<double> score_list, vector<int> using_time, vector<Pose3D> pose_list);
	void show3d(boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer,
		map<string, pcl::PointCloud<PointIoType>::Ptr>& map,
		pcl::PointCloud<PointIoType>::Ptr GT);
	void appInit();
	void appRun();
	


private:
	clock_t start_time, end_time;
	PoseGrabber mPoseGrabber;
	Mapping mMapping;
	Config mConfig;
	Observation mObservation;
	vector<Pose3D> mGroundTruth;
	Fitting mFitting;
	boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer;
	confi mconfig;
};

